wayland: check parent surface for subsurface
authorOlivier Fourdan <ofourdan@redhat.com>
Tue, 16 May 2017 14:13:34 +0000 (16:13 +0200)
committerOlivier Fourdan <ofourdan@redhat.com>
Fri, 2 Jun 2017 13:43:06 +0000 (15:43 +0200)
commit08aade4b7c4ff011402aada4270a6c4260d30958
treeed188782a96c55d08a1d85a6b9adbb5e7f5db107
parenta84fc3878477832a879df278d82f98a03c75a2b7
wayland: check parent surface for subsurface

When an event is received while a tooltip is showing, the GtkTooltip's
event handling code can end up calling gdk_window_set_transient_for()
from gtk_tooltip_set_last_window().

The Wayland GDK backend will try to automatically create a subsurface
in gdk_wayland_window_set_transient_for() but if the parent surface is
gone meanwhile, this will will cause a crash when trying to create a
subsurface from a parent with a null surface.

Checking for the parent is not sufficient, we ought to check for the
parent surface as well to avoid the crash.

https://bugzilla.gnome.org/show_bug.cgi?id=782283
gdk/wayland/gdkwindow-wayland.c